<%--
  Created by IntelliJ IDEA.
  User: 86138
  Date: 2021/9/18
  Time: 15:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div class="col-md-10">
    <div class="panel panel-default">
        <div class="panel-heading">账户管理</div>
        <div class="panel-body">

            <table
                    class="table table-hover table-bordered table-condensed book-manage">
                <tr>
                    <td colspan="9">
                        <!-- Button trigger modal
                        <button type="button" class="btn btn-primary btn-block"
                            data-toggle="modal" data-target="#myModal">
                            <i class="glyphicon glyphicon-plus" data-toggle="modal"
                                data-target="#myModal"></i> 增加菜单
                        </button>--> <a href="userServlet?method=userAddUI"
                                                    class="btn btn-primary btn-block"><i
                            class="glyphicon glyphicon-plus"></i>添加帐号</a>
                    </td>
                </tr>
                <tr>

                    <th>帐号</th>
                    <th>姓名</th>
                    <th>密码</th>
                    <th>职位</th>
                    <th>联系方式</th>
                    <th>操作</th>
                </tr>
                <c:forEach items="${page.list }" var="user">
                    <tr>
                        <input type="hidden" value='${ user.id}'>
                        <td>${user.id }</td>
                        <td>${user.name }</td>
                        <td><button class="btn btn-warning btn-xs for-password-button"> 初始化密码</button></td>
                        <td>${user.role.name }</td>
                        <td>${user.tell }</td>
                        <td>

                            <a data-trigger="confirm" data-content="确定要删除用户：  ${user.name } 吗？" href="userServlet?method=delUser&id=${user.id}&pageNum=${page.pageNo}"   class="btn btn-danger btn-sm">删除</a>

                            <a
                                    href="userServlet?method=toModifyUI&id=${user.id}&pageNum=${page.pageNo}"
                                    class="btn btn-info btn-sm">修改</a>
                        </td>
                    </tr>
                </c:forEach>

            </table>

            <nav class="text-center">
                <ul class="pagination">
                    <li class=" ${page.hasPrev == true?"":"disabled"}"><a
                            href="userServlet?method=toUserManageUI&pageNum=1"> <span
                            aria-hidden="true">首页</span> </a>
                    </li>

                    <li class=" ${page.hasPrev == true?"":"disabled"}"><a
                            href="userServlet?method=toUserManageUI&pageNum=${page.prevPage }"
                            aria-label="Previous"> <span aria-hidden="true">&laquo;上一页</span>
                    </a>
                    </li>

                    <li class="disabled"><a>第 ${page.pageNo } 页 共
                        ${page.totalPageNumber } 页</a>
                    </li>
                    <li class=" ${page.hasNext == true?"":"disabled"}"><a
                            href="userServlet?method=toUserManageUI&pageNum=${page.nextPage}"
                            aria-label="Next"> <span aria-hidden="true">下一页&raquo;</span>
                    </a>
                    </li>
                    <li class=" ${page.hasNext == true?"":"disabled"}"><a
                            href="userServlet?method=toUserManageUI&pageNum=${page.totalPageNumber}">
                        <span aria-hidden="true">末页</span> </a>
                    </li>
                </ul>
            </nav>
        </div>
    </div>
</div>
</body>
</html>
